<%@ page contentType="text/html;charset=UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <title>后台管理 - 易买网</title>
    <link type="text/css" rel="stylesheet" href="/css/style.css"/>
    <script type="text/javascript" src="/scripts/function-manage.js"></script>
</head>

<body>
<%@ include file="/WEB-INF/manage/common/head.jsp" %>
<%@ include file="/WEB-INF/manage/common/position.jsp" %>
<div id="main" class="wrap">
    <%@include file="/WEB-INF/manage/common/left.jsp" %>
    <div class="main">
        <h2>留言管理</h2>
        <div class="manage">
            <table class="list">
                <tr>
                    <th>ID</th>
                    <th>姓名</th>
                    <th>留言内容</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                <c:forEach items="${commentPage.records}" var="comment">
                    <tr>
                        <td class="first w4 c">${comment.id}</td>
                        <td class="w1 c">${comment.nickName}</td>
                        <td>${comment.content}</td>
                        <td class="w1 c">
                            <c:choose>
                                <c:when test="${comment.reply == null}">未回复</c:when>
                                <c:when test="${comment.reply != null}">已回复</c:when>
                            </c:choose>
                        </td>
                        <td class="w1 c"><a href="/comment/update_input?id=${comment.id}">回复</a><a
                                href="javascript:Delete('/comment/delete?id=${comment.id}');">删除</a></td>
                    </tr>
                </c:forEach>

            </table>
            <div class="pager">
                <ul class="clearfix">
                    <li><a href="/comment/list?current=${commentPage.hasPrevious()?commentPage.current-1:1}">上一页</a>
                    </li>
                    <c:forEach var="index" begin="1" end="${totalPage}" step="1">
                        <li class="current1"><a href="/comment/list?current=${index}">${index}</a></li>
                    </c:forEach>
                    <li>
                        <a href="/comment/list?current=${commentPage.hasNext()?commentPage.current+1:totalPage}">下一页</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="clear"></div>
</div>
<%@ include file="/WEB-INF/common/footer.jsp" %>
</body>
</html>